#include "LedApp.h"

void Fun_Init(void)
{
	uint8_t i = 0;
	const uint8_t __far *pCh     = &pChnMap_LB;
	const uint16_t __far *pOnR   = &OnRampT_LB;
	const uint16_t __far *pOffR  = &OffRampT_LB;
	const uint8_t __far *pOnDel  = &OnDelayT_LB;
	const uint8_t __far *pOffDel = &OffDelayT_LB;
	
	for (i = 0; i < sizeof(FunTable) / sizeof(FunTable[0]); i++)
	{
		FunTable[i].MapChannel = *(pCh + i);
	}
}

void Fun_Detect(LED_FUNC_ACTIVE_EM Fun)
{
	FunTable[Fun].Cmd = Get_LightWorkCmd(Fun);
}

void Fun_MainUpData(void)
{
	LED_FUNC_ACTIVE_EM i = FUNC_ACTIVE_LB;

	for (i = FUNC_ACTIVE_LB; i < FUNC_ACTIVE_MAX; i++)
	{
		Fun_Detect(i);
	}
}

void LedApp_MainFunction(void)
{
	Fun_MainUpData();
}
